//
//  WebViewController.swift
//  test-ios
//
//  Created by wyz5204 on 2023/3/16.
//

import UIKit
import WebKit

class WebViewController: UIViewController , WKUIDelegate , WKNavigationDelegate{
    
    private lazy var web : WKWebView = {
        return WKWebView()
    }()
    
    override func viewDidLoad() {
        self.view.backgroundColor = .white
        web.addTo(self.view) { view in
            view.snp.makeConstraints { make in
                make.edges.equalToSuperview()
            }
        }
        web.uiDelegate = self
        web.navigationDelegate = self
        web.allowsBackForwardNavigationGestures = true
        
    }
    
    override func viewDidAppear(_ animated: Bool) {
        web.load(URLRequest.init(url: URL.init(string: "https://home.firefoxchina.cn/")!))
    }
}
